home *** CD-ROM | disk | FTP | other *** search
- /* arexx Script */
-
- call addlib("rexxmathlib.library", 5, -30, 0)
-
- options results
- parse ARG Port x y r b
-
- ADDRESS value Port
-
- pp_CountFrames
- Total_Frame=result
- if Total_Frame=0 then Total_Frame=1
- Start_Frame=1
- End_Frame=Total_Frame
-
- t=TIME(N)
- Start_t=t
- End_t=t
-
- Anim=0;Path=0;Type=0
- Start_O=100;End_O=100
- Start_S=r;End_S=r
- Rayon=r
-
- R=-1
-
- DO UNTIL R>-1
-
- pp_DialogInit 250 200 "*CLOCK*" 7
- pp_Cycle 0 70 5 100 16 "Animation" 1 "No|Yes" Anim
- pp_Cycle 1 70 35 100 16 "Path" 1 "None|Left|Right|Up|Down" Path
- pp_Cycle 2 70 53 100 16 "Type" 1 "In|Out" Type
- pp_Button 3 20 71 200 16 '*Frame*(*#'||Start_Frame||'->#'||End_Frame||'*)*'
-
- pp_Button 4 20 100 200 16 '*Time*(*'||Start_t||'*->*'||End_t||'*)*'
- pp_Button 5 20 120 200 16 '*Size*(*'||Start_S||'*->*'||End_S||'*)*'
- pp_Button 6 20 140 200 16 '*Opacity*(*'||Start_O||'*->*'||End_O||'*)*'
-
- pp_Dialog
- R=result
-
- pp_GetDialog 0
- Anim=result
-
- pp_GetDialog 1
- Path=result
-
- pp_GetDialog 2
- Type=result
-
- if R=-3 then DO
- pp_DialogInit 150 80 "*FRAME*" 2
- pp_Integer 0 60 5 50 16 "Start" 1 Start_Frame
- pp_Integer 1 60 25 50 16 "End" 1 End_Frame
- pp_Dialog
- rc=result
- IF rc=1 then DO
- pp_GetDialog 0
- Start_Frame=result
-
- pp_GetDialog 1
- End_Frame=result
-
- IF End_Frame>Total_Frame THEN DO
- End_Frame=Total_Frame
- END
-
- IF Start_Frame>End_Frame THEN DO
- Start_Frame=1
- END
-
- END
- END
-
- if R=-4 then DO
- if Anim=1 then DO
- pp_DialogInit 150 75 "*TIME*" 2
- pp_String 0 50 5 70 16 "Start" 1 10 Start_t
- pp_String 1 50 25 70 16 "End" 1 10 End_t
- pp_Dialog
- rc=result
- IF rc=1 then DO
- pp_GetDialog 0
- Start_t=result
- pp_GetDialog 1
- End_t=result
- END
- END
- ELSE DO
- pp_DialogInit 150 55 "*TIME*" 1
- pp_String 0 50 5 70 16 "Time" 1 10 Start_t
- pp_Dialog
- rc=result
- IF rc=1 then DO
- pp_GetDialog 0
- Start_t=result
- End_t=result
- END
- END
- END
-
- if R=-5 then DO
- if Anim=1 then DO
- pp_DialogInit 150 75 "*SIZE*" 2
- pp_Integer 0 60 5 50 16 "Start" 1 Start_S
- pp_Integer 1 60 25 50 16 "End" 1 End_S
- pp_Dialog
- rc=result
- IF rc=1 then DO
- pp_GetDialog 0
- Start_S=result
- pp_GetDialog 1
- End_S=result
- END
- END
- ELSE DO
- pp_DialogInit 150 55 "*SIZE*" 1
- pp_Integer 0 60 5 50 16 "Size" 1 Start_S
- pp_Dialog
- rc=result
- IF rc=1 then DO
- pp_GetDialog 0
- Start_S=result
- End_S=result
- END
- END
- END
-
- if R=-6 then DO
- if Anim=1 then DO
- pp_DialogInit 150 75 "*OPACITY*" 2
- pp_Integer 0 60 5 50 16 "Start" 1 Start_O
- pp_Integer 1 60 25 50 16 "End" 1 End_O
- pp_Dialog
- rc=result
- IF rc=1 then DO
- pp_GetDialog 0
- Start_O=result
- pp_GetDialog 1
- End_O=result
- END
- END
- ELSE DO
- pp_DialogInit 150 55 "*OPACITY*" 1
- pp_Integer 0 75 5 50 16 "Opacity" 1 Start_O
- pp_Dialog
- rc=result
- IF rc=1 then DO
- pp_GetDialog 0
- Start_O=result
- End_O=result
- END
- END
- END
- END
-
- if R=0 then DO
- EXIT
- END
-
- Start_h=substr(Start_t,1,2)
- End_h=substr(End_t,1,2)
-
- Start_m=substr(Start_t,4,2)
- End_m=substr(End_t,4,2)
-
- Start_Time=Start_h*60+Start_m
- End_Time=End_h*60+End_m
-
- IF Anim=0 then DO
- pp_UpdateUndoBox x-rayon-5 y-rayon-5 x+rayon+5 y+rayon+5
- IF Start_O<100 then DO
- pp_EffectOn
- pp_Trans Start_O
- CALL Clock(Start_h,Start_m,x,y,Start_S)
- pp_EffectOff
- END
- ELSE DO
- CALL Clock(Start_h,Start_m,x,y,Start_S)
- END
- END
- ELSE DO
-
- pp_CountFrames
- IF result<2 then do
- pp_Warn 'Make*an*Anim*first.'
- EXIT
- END
-
- pp_GetWidth
- W=result
-
- pp_GetHeight
- H=result
-
- HX=Start_S
- HY=Start_S
-
- Start_X=x
- End_X=x
- Start_Y=y
- End_Y=y
-
- IF Path=1 then DO
- IF Type=0 then DO
- Start_X=HX*-1
- END
- ELSE DO
- End_X=HX*-1
- END
- END
-
- IF Path=2 then DO
- IF Type=0 then DO
- Start_X=W+HX
- END
- ELSE DO
- End_X=W+HX
- END
- END
-
- IF Path=3 then DO
- IF Type=0 then DO
- Start_Y=HY*-1
- END
- ELSE DO
- End_Y=HY*-1
- END
- END
-
- IF Path=4 then DO
- IF Type=0 then DO
- Start_Y=H+HY
- END
- ELSE DO
- End_Y=H+HY
- END
- END
-
- step=(End_Frame-Start_Frame)
-
- Step_O=(End_O-Start_O)/Step
- Step_S=(End_S-Start_S)/Step
- Step_X=(End_X-Start_X)/Step
- Step_Y=(End_Y-Start_Y)/Step
- Step_m=(End_m-Start_m)/Step
- Step_h=(End_h-Start_h)/Step
- Step_Time=(End_Time-Start_Time)/Step
-
- DO i=Start_Frame to End_Frame
-
- pp_GotoFrame i
- r=trunc(Start_S+Step_S*(i-Start_Frame)+0.5,0)
- O=trunc(Start_O+Step_O*(i-Start_Frame)+0.5,0)
- x1=trunc(Start_X+Step_X*(i-Start_Frame)+0.5,0)
- y1=trunc(Start_Y+Step_Y*(i-Start_Frame)+0.5,0)
- Time=trunc(Start_Time+Step_Time*(i-Start_Frame)+0.5,0)
-
- h=trunc(Time/60,0)
- m=Time//60
-
- IF O<100 then DO
- pp_EffectOn
- pp_Trans O
- CALL Clock(h,m,x1,y1,r)
- pp_EffectOff
- END
- ELSE DO
- CALL Clock(h,m,x1,y1,r)
- END
-
- END
-
- pp_GotoFrame Start_Frame
- END
-
-
- Clock: PROCEDURE
-
- h=ARG(1)
- m=ARG(2)
- x=ARG(3)
- y=ARG(4)
- r=ARG(5)
-
- h=h+(m/60)
-
- pp_Circle x y r
-
- ang=((360/12)*3.14)/180
- d=r-(r/8)
-
- DO i=0 to 360-ang by (360/12)
-
- a=cos(i*3.14/180) * d
- b=sin(i*3.14/180) * d
-
- pp_line (x+a) (y-b) (x+a) (y-b)
- END
-
-
- i=h * 360/12
- d=r/2
- a=sin(i*3.14/180) * d
- b=cos(i*3.14/180) * d
- pp_line x y (x+a) (y-b)
-
- i=m * 360/60
- d=r-(r/8)
- a=sin(i*3.14/180) * d
- b=cos(i*3.14/180) * d
- pp_line x y (x+a) (y-b)
- RETURN
-
-
- EXIT
-
-
-
-